<?php
/**
 * GetLandingPageMetadataResponseContent
 *
 * PHP version 5
 *
 * @category Class
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */

/**
 * Sponsored Brands campaign management
 *
 * Create and manage Sponsored Brands campaigns.   To learn more about Sponsored Brands campaigns, see:   - [Sponsored Brands overview](guides/sponsored-brands/overview)  - [Sponsored Brands campaign structure](guides/sponsored-brands/campaigns/structure)  - [Get started with Sponsored Brands campaigns](guides/sponsored-brands/campaigns/get-started-with-campaigns)
 *
 * OpenAPI spec version: 4.0
 * 
 * Generated by:https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api.git
 * AmazonAdvertisingApi Codegen version: 3.0.51
 */
/**
 * NOTE: This class is auto generated by the AmazonAdvertisingApi code generator program.
 *https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 * Do not edit the class manually.
 */

namespace AmazonAdvertisingApi\Model;

use \ArrayAccess;
use \AmazonAdvertisingApi\ObjectSerializer;

/**
 * GetLandingPageMetadataResponseContent Class Doc Comment
 *
 * @category Class
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */
class GetLandingPageMetadataResponseContent implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $AmazonAdvertisingApiModelName = 'GetLandingPageMetadataResponseContent';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiTypes = [
        'page_type' => 'string',
        'canonical_url' => 'string',
        'un_supported_reason' => 'string',
        'is_supported' => 'bool',
        'un_supported_reason_code' => 'string'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiFormats = [
        'page_type' => null,
        'canonical_url' => null,
        'un_supported_reason' => null,
        'is_supported' => null,
        'un_supported_reason_code' => null
    ];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiTypes()
    {
        return self::$AmazonAdvertisingApiTypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiFormats()
    {
        return self::$AmazonAdvertisingApiFormats;
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'page_type' => 'pageType',
        'canonical_url' => 'canonicalUrl',
        'un_supported_reason' => 'unSupportedReason',
        'is_supported' => 'isSupported',
        'un_supported_reason_code' => 'unSupportedReasonCode'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'page_type' => 'setPageType',
        'canonical_url' => 'setCanonicalUrl',
        'un_supported_reason' => 'setUnSupportedReason',
        'is_supported' => 'setIsSupported',
        'un_supported_reason_code' => 'setUnSupportedReasonCode'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'page_type' => 'getPageType',
        'canonical_url' => 'getCanonicalUrl',
        'un_supported_reason' => 'getUnSupportedReason',
        'is_supported' => 'getIsSupported',
        'un_supported_reason_code' => 'getUnSupportedReasonCode'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$AmazonAdvertisingApiModelName;
    }



    /**
     * Associative array for storing property values
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['page_type'] = isset($data['page_type']) ? $data['page_type'] : null;
        $this->container['canonical_url'] = isset($data['canonical_url']) ? $data['canonical_url'] : null;
        $this->container['un_supported_reason'] = isset($data['un_supported_reason']) ? $data['un_supported_reason'] : null;
        $this->container['is_supported'] = isset($data['is_supported']) ? $data['is_supported'] : null;
        $this->container['un_supported_reason_code'] = isset($data['un_supported_reason_code']) ? $data['un_supported_reason_code'] : null;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        if ($this->container['page_type'] === null) {
            $invalidProperties[] = "'page_type' can't be null";
        }
        if ($this->container['canonical_url'] === null) {
            $invalidProperties[] = "'canonical_url' can't be null";
        }
        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


    /**
     * Gets page_type
     *
     * @return string
     */
    public function getPageType()
    {
        return $this->container['page_type'];
    }

    /**
     * Sets page_type
     *
     * @param string $page_type The type of landing page, such as store page, product list (simple landing page), custom url. | Page Type    | |--------------| | PRODUCT_LIST | | STORE        | | CUSTOM_URL   | | DETAIL_PAGE  |
     *
     * @return $this
     */
    public function setPageType($page_type)
    {
        $this->container['page_type'] = $page_type;

        return $this;
    }

    /**
     * Gets canonical_url
     *
     * @return string
     */
    public function getCanonicalUrl()
    {
        return $this->container['canonical_url'];
    }

    /**
     * Sets canonical_url
     *
     * @param string $canonical_url A canonical URL is the URL that represents the best version of landing page URL from a group of duplicate landing page URLs. For example, if you have two landing page URLs for the same page (such as amazon.it/HSA/pages/default?pageId=B59A592C-8A12-4684-A37E-2416FD594D87 and amazon.it/stores/page/B59A592C-8A12-4684-A37E-2416FD594D87), we chooses one as canonical. In this case, canonical url is amazon.it/stores/page/B59A592C-8A12-4684-A37E-2416FD594D87
     *
     * @return $this
     */
    public function setCanonicalUrl($canonical_url)
    {
        $this->container['canonical_url'] = $canonical_url;

        return $this;
    }

    /**
     * Gets un_supported_reason
     *
     * @return string
     */
    public function getUnSupportedReason()
    {
        return $this->container['un_supported_reason'];
    }

    /**
     * Sets un_supported_reason
     *
     * @param string $un_supported_reason A human-readable description of the unSupportedReasonCode field.
     *
     * @return $this
     */
    public function setUnSupportedReason($un_supported_reason)
    {
        $this->container['un_supported_reason'] = $un_supported_reason;

        return $this;
    }

    /**
     * Gets is_supported
     *
     * @return bool
     */
    public function getIsSupported()
    {
        return $this->container['is_supported'];
    }

    /**
     * Sets is_supported
     *
     * @param bool $is_supported This field determines whether the landing page is supported for the ad product.
     *
     * @return $this
     */
    public function setIsSupported($is_supported)
    {
        $this->container['is_supported'] = $is_supported;

        return $this;
    }

    /**
     * Gets un_supported_reason_code
     *
     * @return string
     */
    public function getUnSupportedReasonCode()
    {
        return $this->container['un_supported_reason_code'];
    }

    /**
     * Sets un_supported_reason_code
     *
     * @param string $un_supported_reason_code Enumerated code for why landing page is unsupported. | Reason Code                 | | SB_DETAIL_PAGE_UNSUPPORTED  | | SB_GATEWAY_PAGE_UNSUPPORTED | | SB_SEARCH_PAGE_UNSUPPORTED  | | SB_BROWSE_PAGE_UNSUPPORTED  | | SB_OTHER_PAGE_UNSUPPORTED   |
     *
     * @return $this
     */
    public function setUnSupportedReasonCode($un_supported_reason_code)
    {
        $this->container['un_supported_reason_code'] = $un_supported_reason_code;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer $offset Offset
     *
     * @return boolean
     */
    #[\ReturnTypeWillChange]
    public function offsetExists($offset)
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        return isset($this->container[$offset]) ? $this->container[$offset] : null;
    }

    /**
     * Sets value based on offset.
     *
     * @param integer $offset Offset
     * @param mixed   $value  Value to be set
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer $offset Offset
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetUnset($offset)
    {
        unset($this->container[$offset]);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
            return json_encode(
                ObjectSerializer::sanitizeForSerialization($this),
                JSON_PRETTY_PRINT
            );
        }

        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}
